package com.medical.patient.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.medical.common.utils.PageUtils;
import com.medical.common.utils.Query;

import com.medical.patient.dao.PatientDiagnoseDao;
import com.medical.patient.entity.PatientDiagnoseEntity;
import com.medical.patient.service.PatientDiagnoseService;


@Service("patientDiagnoseService")
public class PatientDiagnoseServiceImpl extends ServiceImpl<PatientDiagnoseDao, PatientDiagnoseEntity> implements PatientDiagnoseService {

    @Autowired
    private PatientDiagnoseDao patientDiagnoseDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<PatientDiagnoseEntity> page = this.page(
                new Query<PatientDiagnoseEntity>().getPage(params),
                new QueryWrapper<PatientDiagnoseEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<PatientDiagnoseEntity> getByDiagnoseId(Integer diagnoseId) {
        List<PatientDiagnoseEntity> patientDiagnoseEntityList = patientDiagnoseDao.getByDiagnoseId(diagnoseId);
        return patientDiagnoseEntityList;
    }

}